package day_2022_9_to_12.Day;

/**
 * @author haomin
 * @date 2022/09/29 22:09
 **/
public class Day28_3_Num162_FindPeakElement {
    class Solution {
        public int findPeakElement(int[] nums) {
            int l = 0, r = nums.length - 1, mid;
            while(l < r){
                mid = l + ((r-l) >> 1);
                if(nums[mid] >= nums[mid + 1]){
                    r = mid;
                }else l = mid + 1;
            }
            return l;
        }
    }
}